<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
*{font-family:Tahoma, Arial, Helvetica, Sans-serif,"宋体";}
table{
	width:85%;
	margin:0px auto;
	font:Georgia 11px;
	font-size:12px;
	color:#333333;
	text-align:center;
	border-collapse:collapse;/*细线表格代码*/
}
table td{
	border:1px solid #999;/*细线表格线条颜色*/
	height:22px;
}
caption{text-align:center;font-size:12px;font-weight:bold;margin:0 auto;}
tr.t1 td {background-color:#fff;}
tr.t2 td {background-color:#eee;}
tr.t3 td {background-color:#ccc;}
th,tfoot tr td{font-weight:bold;text-align:center;background:#c5c5c5;}
th{line-height:30px;height:30px;}
tfoot tr td{background:#fff;line-height:26px;height:26px;}
thead{border:1px solid #999;}
thead tr td{text-align:center;}
#page{text-align:center;float:right;}
#page a,#page a:visited{width:60px;height:22px;line-height:22px;border:1px black solid;display:block;float:left;margin:0 3px;background:#c9c9c9;
text-decoration:none;}
#page a:hover{background:#c1c1c1;text-decoration:none;}
.grayr {padding:2px;font-size:11px;background:#fff;float:right;}
.grayr a {padding:2px 5px;margin:2px;color:#000;text-decoration:none;;border:1px #c0c0c0 solid;}
.grayr a:hover {color:#000;border:1px orange solid;}
.grayr a:active {color:#000;background: #99ffff}
.grayr span.current {padding:2px 5px;font-weight:bold; margin:2px; color: #303030;background:#fff;border:1px orange solid;}
.grayr span.disabled {padding:2px 5px;margin:2px;color:#797979;background: #c1c1c1;border:1px #c1c1c1 solid;}
a{
	text-decoration:none;
	}
	img{
		border:0px;}
-->
</style>
<script src="../admin_core/templates/admin/js/list.js"></script>
<script type="text/javascript"><!--
function selectPage(obj)
{

	var value = obj.value;
	document.location.href="control.php?action=newsList&page="+value+"&countPage=#{$countPage}#&count=#{$count}#";
	}
	function select()
	{
		var logList =  document.getElementsByName("newsId[]");
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			obj.checked =!obj.checked;
			}
		
	}
	function checkChecked()
	{
		var logList =  document.getElementsByName("newsId[]");
		var checkState = false;
		for(var i=0;i<logList.length;i++)
		{
			var obj = logList[i];
			if(obj.checked)
				{
				checkState = true;
				}
			
			}
		if(!checkState)
			{
			alert("至少选中一个！");
			}
		else
			{
			if(confirm("确认删除吗？"))
			document.getElementById('selectForm').submit();
			}
	}
	function checkNewsDetail(newsId)
	{
		window.open('../readNewsDetail.php?newsId='+newsId,'新闻信息' ,'height=500, width=900, top=0,left=0, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
		}
--></script>
<script type="text/javascript" src="date/WdatePicker.js"></script>
</head>

<body style="text-align:center;">
<center>

<fieldset  style=" width:1110px;">
<legend><img src="images/311.gif"/>&nbsp;<span style="color:#333; font-size:15px; font-weight:bold;">新闻列表</span></legend>
<form id="selectForm" action="control.php?action=deletNewsBatch" method="post">
<table>
  <caption style="font-size:14px;">
  所有新闻列表
    #{if $logintype=="admin"}#
  (+<a href="../addNews.php">添加新闻</a>)
  #{/if}#
  </caption>
  <thead>
    <tr>
    #{if $logintype=="admin"}#
      <th width="10%" onclick="select()" style="cursor: pointer;" title="全选/反选">全选/反选</th>
      #{/if}#
      <th width="40%">新闻标题</th>
      <th width="15%"%">发布部门</th>
      <th width="15%">发布时间</th>
       <th width="20%">操作</th>
    </tr>
  </thead>
  <tbody id="tab">
#{if $count==0}#
<tr>
<td colspan="#{if $logintype=="admin"}#5#{else}#4#{/if}# " align="center" style="text-align:center;">
暂无数据！
</td>
</tr>
#{else}#
    #{foreach from=$list item=news}#
      <tr onmousemove="changeBackColor(this)" onmouseout="removeBackColor(this)">
      #{if $logintype=="admin"}#
      <td width="10%" align="center">
      <input name="newsId[]" type="checkbox" value="#{$news->getNews_id()}#" />
      </td>
      #{/if}#
      <td width="40%" align="left" style="padding-left:5px;">#{$news->getNews_title()}#</td>
      
      <td width="15%" align="left" style="padding-left:5px;">#{$news->getNews_department()}#</td>
      <td width="15%" align="center">[#{$news->getNews_date()}#]</td>
       <td>
       #{if $logintype=="admin"}#
        <a href="../modifyNews.php?newsId=#{$news->getNews_id()}#" title="修改该新闻信息"><img title="修改该新闻信息" src="images/table_(edit)_16x16.gif" width="14" height="14"/>修改新闻</a>
       #{/if}#
       <a href="#" onclick="checkNewsDetail(#{$news->getNews_id()}#)"> <img src="images/view_16x16.gif" title="获取新闻详细信息" width="14" height="14"/>查看详情</a></td>
      </tr>
 #{/foreach}#
#{if $logintype=="admin"}#
 <tr>
 
 <td align="center" style="border-right:0px; cursor: pointer; border-right: 1px #999 solid;"  onclick="select()" title="全选/反选">
 全选/反选
 </td>

 <td colspan="4" align="left" style="text-align:left; border-left:0px;">
 <input type="button" value=" 删除选中记录 "   style="font-size:13px; width:100px; height:25px;" onclick="checkChecked()"/> 
 </td>
 </tr>
 #{/if}#
 #{/if}#
  </tbody>
  <tfoot>
  <tr>
  <td colspan="#{if $logintype=="admin"}#5#{else}#4#{/if}# " align="right" style="text-align:right;">
  共有#{$count}#条记录 总共有#{$countPage}#页 当前为#{$start}#-#{$end}#条 在第#{$nowPage}#页
  #{if $nowPage==1}#
 上一页
  #{else}#
  <a href="control.php?action=newsList&page=#{$nowPage-1}#&countPage=#{$countPage}#&count=#{$count}#">上一页</a>
  #{/if}#

  #{if $countPage>$nowPage}#
   <a href="control.php?action=newsList&page=#{$nowPage+1}#&countPage=#{$countPage}#&count=#{$count}#"> 下一页</a>
  #{else}#
  下一页
  #{/if}#
  跳至<select onchange="selectPage(this)">
  #{section loop=$countPage name=a}#
<option value="#{$smarty.section.a.iteration}#" #{if $smarty.section.a.iteration==$nowPage}# selected="selected"#{/if}#>#{$smarty.section.a.iteration}#页</option>
#{/section}#
</select>
  &nbsp;&nbsp;
  
  </td>
  </tr>
  </tfoot>
  
</table>
</form>
</fieldset>
</center>
</body>
</html>
